#define LAND_GRAPHICS_CORE

#include "init.h"

static struct {
	LandBackend* backend;
}ctx = { 0 };

LAND_GRAPHICS_API int
landInitGraphics(LandGraphics* config, LandBackend* backend){
	ctx.backend = backend;
	landInitWindowContext(config, backend->window);
	landInitTextureContext(config, backend->texture);
	landInitDrawContext(config, backend->draw);
	landInitShaderContext(config, backend->shader);
	landInitCanvasContext(config, backend->canvas);
	landInitVertexContext(config, backend->vertex);
	landInitStdContext(config, backend->std);
	landInitFontContext(config);
	backend->init(config);
	return 0;
}

LAND_GRAPHICS_API void
landDefaultGraphics(LandGraphics* config){
}

LAND_GRAPHICS_API int
landDispatchGraphics() {
	ctx.backend->dispatch();
	return 0;
}